package it.tukano.treditor.engine.scene;

import it.tukano.treditor.engine.geom.EulerSet;
import it.tukano.treditor.engine.geom.NTuple3;
import it.tukano.treditor.engine.mesh.Mesh3D;
import java.io.Serializable;

public class MeshElement implements SceneElement, Serializable {
    
    /* default serial version uid*/
    private static final long serialVersionUID = 0;
    
    private Mesh3D mesh;
    private NTuple3 localTranslation = new NTuple3();
    private EulerSet localRotation = new EulerSet();
    private NTuple3 localScale = new NTuple3(1, 1, 1);
    private SceneElement parent;

    /**
     * Instance initializer
     */
    public MeshElement() {
    }

    public synchronized Mesh3D getMesh() {
        return mesh;
    }

    public synchronized MeshElement setMesh(Mesh3D mesh) {
        this.mesh = mesh;
        return this;
    }
    
    public synchronized EulerSet getLocalRotation() {
        return localRotation;
    }

    public synchronized void setLocalRotation(EulerSet localRotation) {
        this.localRotation = localRotation;
    }

    public synchronized NTuple3 getLocalScale() {
        return localScale;
    }

    public synchronized void setLocalScale(NTuple3 localScale) {
        this.localScale = localScale;
    }

    public synchronized NTuple3 getLocalTranslation() {
        return localTranslation;
    }

    public synchronized void setLocalTranslation(NTuple3 localTranslation) {
        this.localTranslation = localTranslation;
    }

    @Override
    public synchronized SceneElement getParent() {
        return parent;
    }

    @Override
    public synchronized void setParent(SceneElement newParent) {
        this.parent = newParent;
    }

    @Override
    public Type getType() {
        return Type.MESH;
    }
}
